bgo#563010 - Fix clearing the selection in GtkFileChooserButton
authorFederico Mena Quintero <federico@novell.com>
Wed, 21 Oct 2009 17:29:03 +0000 (12:29 -0500)
committerFederico Mena Quintero <federico@novell.com>
Wed, 21 Oct 2009 17:29:03 +0000 (12:29 -0500)
Previously the filename would get re-set on the button if one cleared the selection,
as an async cancellable was not getting canceled in that case.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
gtk/gtkfilechooserbutton.c

index 4319bb029825c67a6fa5161b2b334f1ce9172e0e..70b0b4f26898325373f2104a2a523a007368bd7b 100644 (file)
@@ -2302,6 +2302,12 @@ update_label_and_image (GtkFileChooserButton *button)
   label_text = NULL;
   pixbuf = NULL;
 
+  if (priv->update_button_cancellable)
+    {
+      g_cancellable_cancel (priv->update_button_cancellable);
+      priv->update_button_cancellable = NULL;
+    }
+
   if (files && files->data)
     {
       GFile *file;
@@ -2333,12 +2339,6 @@ update_label_and_image (GtkFileChooserButton *button)
            goto out;
        }
 
-      if (priv->update_button_cancellable)
-       {
-         g_cancellable_cancel (priv->update_button_cancellable);
-         priv->update_button_cancellable = NULL;
-       }
-
       if (g_file_is_native (file))
        {
          priv->update_button_cancellable =